package common;

import java.math.BigInteger;

public class Converter {
	public static long hexToLong(String hexString) {
		return Long.parseLong(new BigInteger(hexString, 16).toString(10));
	}
	
	public static long turnOnBit(long number, int index) {
		long r = number | (1 << index);
		
		return r;
	}
	
	public static String longToHex(long decimal) {
		String decimalString = String.valueOf(decimal);
		return String.valueOf(new BigInteger(decimalString, 10).toString(16));
	}
}
